package com.magina.common.bean2xml;

import lombok.Getter;
import lombok.Setter;

import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.util.Date;
import java.util.Map;

@XmlRootElement(name = "DaughterModel")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(propOrder = {  "DauProTwo","FatherPropOne", "DauProOne" , "DauDateOne", "DauDateTwo","DauMap"})
@Setter
@Getter
public class DaughterModel extends FatherModel {
    @XmlElement
    private String DauProOne ;
    @XmlElement
    private String DauProTwo;
    @XmlElement
    @XmlJavaTypeAdapter(JaxbDateAdapter.class)
    private Date DauDateOne;

    @XmlElement
    @XmlJavaTypeAdapter(JaxbDateStrAdapter.class)
    private String DauDateTwo;

    //有互相排斥的注释 @javax.xml.bind.annotation.XmlElement 和 @javax.xml.bind.annotation.XmlElementRef
    @XmlJavaTypeAdapter(value=MapAdapter.class)
//    @XmlElementWrapper(name="DauMapWrapper")
    private Map DauMap;
}